
package com.ukao.steward.pesenter.valetRunners;

import com.ukao.steward.base.BasePresenter;
import com.ukao.steward.bean.PersonalCenterBean;
import com.ukao.steward.consts.Constant;
import com.ukao.steward.consts.SaveParams;
import com.ukao.steward.retrofit.ApiCallback;
import com.ukao.steward.view.valetRunners.PersonalCenterView;

import java.util.HashMap;

import rx.Observable;

/**
 * Created by ukaodev on 2017/6/28.
 */

public class PersonalCenterPesenter extends BasePresenter<PersonalCenterView> {


    public PersonalCenterPesenter(PersonalCenterView view) {
        attachView(view);
    }




    /**
     用户信息
     */
    public void workerdetail(    ) {

        HashMap mHashMap = new HashMap<String, String>();
        mHashMap.put("accessToken", SaveParams.getToken());
        Observable observable=null;
            observable=apiStores.workerdetail(Constant.createParameter(mHashMap));
        addSubscription(observable,
                new ApiCallback<PersonalCenterBean>() {
                    @Override
                    public void onSuccess(PersonalCenterBean model) {

                        if (model.getHttpCode() == 200) {

                        mvpView.useInfoSucceed(model.getData());

                        }else{

                            mvpView.showError(model.getMsg());
                        }

                    }


                    @Override
                    public void onFinish() {

                        mvpView.hideLoading();

                    }
                });

    }


}
